Skip to content

build: centralize system library staging - #339

Open
ardentperf wants to merge 5 commits into
cloudnative-pg:mainfrom
ardentperf:x-ai/ardentperf/upstream-stage-system-libs
Open

build: centralize system library staging#339
ardentperf wants to merge 5 commits into
cloudnative-pg:mainfrom
ardentperf:x-ai/ardentperf/upstream-stage-system-libs

Conversation

@ardentperf

Copy link
Copy Markdown

while working on adding extensions at the downstream project CNPG-Extensions, I have onboarded quite a few additional extensions that require system libraries. (Examples: h3, mobilitydb, mysql-fdw, plr, tds-fdw, etc)

this requires the same logic that postgis has to recursively find and stage system libraries in the extension container image. rather than duplicating all of this logic across a bunch of extensions, it makes more sense to move the logic into a shared script. it works fairly well.

note that i had to change the context in the root docker-bake.hcl file. i dont think this breaks any existing extensions; i dont think any were doing COPY into their builder image yet.

i did need to also add a second symlink resolution loop. this is technically not needed for postgis but it would be needed for extensions like mysql-fdw that pass in a symlink as an argument.

Validation

  • bash -n scripts/stage_system_libs.sh
  • PostGIS Bake checks for bookworm and trixie
  • Full PostGIS cache-only builds for PostgreSQL 18 on linux/amd64 and linux/arm64
  • Bake checks for all eight upstream extension targets
  • GitHub API commit verification: verified: true, reason: valid

nb. please squash merge and don't attribute my bot 🙂

Port the dynamic system-library staging helper from a0822b5 to the upstream extension tree and update the shared Bake context so PostGIS can use it.
Keep the upstream Docker Bake context unchanged by placing the helper under postgis/scripts.
Restore the already-tested root-context layout so the shared helper remains in scripts/.
PostGIS passes extension-library globs, so the helper needs only its single symlink-reconstruction pass; retain the explicit alias handling only when a future caller requires it.
Keep the explicit input-alias pass and document why it is needed when ldd reports only a resolved soname, such as the libmysqlclient.so case.
@ardentperf
ardentperf requested a review from a team as a code owner September 13, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant